<?php
require_once (APPPATH.'libraries/stringutils.php');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
	<head>
		<meta charset="utf-8">
	</head>
	
	<body>
		<?php
			$categories = $GLOBALS['CATEGORIES'];
			echo "count=".count($categories);
		?>
		<?php if ($productType->getId() > 0): ?>
			<p><?php echo $productType->getId() ?></p>
			<p><?php echo $productType->getCategoryId() ?></p>
			<p><?php echo $productType->getTitle() ?></p>
		<?php else: ?>
			<p>Can not find product type</p>
		<?php endif ?>
		
		<?php echo form_open('producttype/deleteproducttype/'.$productType->getId()) ?>
			<input type="submit" value="delete" />
		</form>
		
		<hr /><?php echo count($products) ?>
		<?php if (count($products) > 0): ?>
			<ul>
				<?php foreach ($products as $product): ?>
					<li>
						<?php echo anchor('product/viewproduct/'.$product->getId(), $product->getDescription()) ?>
						
						<?php
							$marks = $product->getMarks();
							if (count($marks) > 0):
						?>
							<?php foreach ($marks as $mark): ?>
								<?php echo $mark->getTitle() ?>-
							<?php endforeach?>
						<?php endif ?>
					</li>
				<?php endforeach?>
			</ul>
		<?php endif?>
	</body>
</html>